package com.example.travelplan.app;

import android.app.Activity;
import android.app.ActivityGroup;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TabHost;
import android.widget.TextView;

import static com.example.travelplan.app.R.*;


public class tabpesquisarActivity extends ActivityGroup {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(layout.activity_tabpesquisar);

        TabHost tabHost = (TabHost)findViewById(id.tabHostVisualizar);

        tabHost.setup(getLocalActivityManager());

        TabHost.TabSpec tab1, tab2;
        Intent intent;

        intent = new Intent().setClass(this, tabListLocalActivity.class);
        tab1 = tabHost.newTabSpec("1").setIndicator("")
                .setContent(intent);
        TextView txVLocal = new TextView(this);
        txVLocal.append("Local");
        txVLocal.setTextColor(color.preto);
        txVLocal.setGravity(Gravity.CENTER);
        txVLocal.setHeight(100);
        tab1.setIndicator(txVLocal);

        intent = new Intent().setClass(this, tabListTipoLugarActivity.class);
        tab2 = tabHost.newTabSpec("2").setIndicator("")
                .setContent(intent);
        TextView txVAtividade = new TextView(this);
        txVAtividade.append("Atividade");
        txVAtividade.setTextColor(color.preto);
        txVAtividade.setGravity(Gravity.CENTER);
        txVAtividade.setHeight(100);
        tab2.setIndicator(txVAtividade);

        tabHost.addTab(tab1);
        tabHost.addTab(tab2);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.tabpesquisar, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

}
